package domain;
// Generated 08-jul-2009 18:53:47 by Hibernate Tools 3.2.1.GA


import java.sql.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Invoice generated by hbm2java
 */
@Entity
@Table(name="invoice"
    ,catalog="domeco"
)
public class Invoice  implements java.io.Serializable {


     private Integer idInvoice;
     private Bankaccount bankaccount;
     private String company;
     private String concept;
     private Date dateExpense;
     private double amount;
     private Set<Insuranceconsumption> insuranceconsumptions = new HashSet<Insuranceconsumption>(0);
     private Set<Waterconsumption> waterconsumptions = new HashSet<Waterconsumption>(0);
     private Set<Mobileconsumption> mobileconsumptions = new HashSet<Mobileconsumption>(0);
     private Set<Electricityconsumption> electricityconsumptions = new HashSet<Electricityconsumption>(0);
     private Set<Mortgageconsumption> mortgageconsumptions = new HashSet<Mortgageconsumption>(0);

    public Invoice() {
    }

	
    public Invoice(Bankaccount bankaccount, String company, Date dateExpense, double amount) {
        this.bankaccount = bankaccount;
        this.company = company;
        this.dateExpense = dateExpense;
        this.amount = amount;
    }
    public Invoice(Bankaccount bankaccount, String company, String concept, Date dateExpense, double amount, Set<Insuranceconsumption> insuranceconsumptions, Set<Waterconsumption> waterconsumptions, Set<Mobileconsumption> mobileconsumptions, Set<Electricityconsumption> electricityconsumptions, Set<Mortgageconsumption> mortgageconsumptions) {
       this.bankaccount = bankaccount;
       this.company = company;
       this.concept = concept;
       this.dateExpense = dateExpense;
       this.amount = amount;
       this.insuranceconsumptions = insuranceconsumptions;
       this.waterconsumptions = waterconsumptions;
       this.mobileconsumptions = mobileconsumptions;
       this.electricityconsumptions = electricityconsumptions;
       this.mortgageconsumptions = mortgageconsumptions;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="idInvoice", unique=true, nullable=false)
    public Integer getIdInvoice() {
        return this.idInvoice;
    }
    
    public void setIdInvoice(Integer idInvoice) {
        this.idInvoice = idInvoice;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="bankFK", nullable=false)
    public Bankaccount getBankaccount() {
        return this.bankaccount;
    }
    
    public void setBankaccount(Bankaccount bankaccount) {
        this.bankaccount = bankaccount;
    }
    
    @Column(name="company", nullable=false, length=250)
    public String getCompany() {
        return this.company;
    }
    
    public void setCompany(String company) {
        this.company = company;
    }
    
    @Column(name="concept", length=250)
    public String getConcept() {
        return this.concept;
    }
    
    public void setConcept(String concept) {
        this.concept = concept;
    }
    @Temporal(TemporalType.DATE)
    @Column(name="dateExpense", nullable=false, length=10)
    public Date getDateExpense() {
        return this.dateExpense;
    }
    
    public void setDateExpense(Date dateExpense) {
        this.dateExpense = dateExpense;
    }
    
    @Column(name="amount", nullable=false, precision=22, scale=0)
    public double getAmount() {
        return this.amount;
    }
    
    public void setAmount(double amount) {
        this.amount = amount;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="invoice")
    public Set<Insuranceconsumption> getInsuranceconsumptions() {
        return this.insuranceconsumptions;
    }
    
    public void setInsuranceconsumptions(Set<Insuranceconsumption> insuranceconsumptions) {
        this.insuranceconsumptions = insuranceconsumptions;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="invoice")
    public Set<Waterconsumption> getWaterconsumptions() {
        return this.waterconsumptions;
    }
    
    public void setWaterconsumptions(Set<Waterconsumption> waterconsumptions) {
        this.waterconsumptions = waterconsumptions;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="invoice")
    public Set<Mobileconsumption> getMobileconsumptions() {
        return this.mobileconsumptions;
    }
    
    public void setMobileconsumptions(Set<Mobileconsumption> mobileconsumptions) {
        this.mobileconsumptions = mobileconsumptions;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="invoice")
    public Set<Electricityconsumption> getElectricityconsumptions() {
        return this.electricityconsumptions;
    }
    
    public void setElectricityconsumptions(Set<Electricityconsumption> electricityconsumptions) {
        this.electricityconsumptions = electricityconsumptions;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="invoice")
    public Set<Mortgageconsumption> getMortgageconsumptions() {
        return this.mortgageconsumptions;
    }
    
    public void setMortgageconsumptions(Set<Mortgageconsumption> mortgageconsumptions) {
        this.mortgageconsumptions = mortgageconsumptions;
    }




}


